<template>
  <div>
    <el-table :data="pckorder" border style="width: 100%">
      <el-table-column prop="id" label="订单ID" width="180"> </el-table-column>
      <el-table-column prop="tenantName" label="下单人">
      </el-table-column>
      <el-table-column prop="money" label="订单金额/元">
      </el-table-column>
      <el-table-column prop="startTime" label="套餐开始时间"> </el-table-column>
      <el-table-column prop="endTime" label="套餐结束时间"> </el-table-column>
      <el-table-column prop="createTime" label="下单时间"> </el-table-column>
      <el-table-column prop="payTime" label="支付时间"> </el-table-column>
      <el-table-column prop="payStatus" label="订单状态">
        <template slot-scope="scope">
          {{ scope.paystatus = 1 ? '已支付' : '未支付'}}
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          
          <el-button
            @click="del(scope.row)"
            icon="el-icon-delete"
            type="danger"
            size="mini"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <el-pagination
      style="float: right"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pageDto.now"
      :page-sizes="[5, 15, 50, 100]"
      :page-size="pageDto.size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>
<script>
import { orderPage } from "@/api/pck";
export default {
  data() {
    return {
      pckorder: [],
      //分页
      pageDto: {
        now: 1,
        size: 5,
        where: {
          payno: "",
        },
      },
      total:""
    };
  },
  methods: {
    handleSizeChange(size) {
        this.pageDto.size = size;
        this.search();
    },
    handleCurrentChange(now) {
        this.pageDto.now = now;
        this.search();
    },
    search() {
      orderPage(this.pageDto).then((res) => {
        console.log(res);
        this.pckorder = res.list;
        this.total = res.total
      });
    },
  },
  created() {
    this.search();
  },
};
</script>
<style lang="css">
</style>